home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Headers / OLE2UI.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  26.0 KB  |  804 lines  |  [TEXT/????]

  1. /*
  2.  * OLE2UI.H
  3.  *
  4.  * Public definitions, structures, types, and function prototypes for the
  5.  * OLE 2.0 User Interface support library.
  6.  *
  7.  * Copyright (c)1992-1994 Microsoft Corporation, All Right Reserved
  8.  */
  9.  
  10.  
  11. #ifndef _OLE2UI_H_
  12. #define _OLE2UI_H_
  13.  
  14.  
  15. #if defined (__cplusplus)  && !defined(__MWERKS__)
  16. extern "C" {
  17. #endif
  18.  
  19.  
  20. #ifndef THINK_C
  21. #include <Dialogs.h>
  22. #include <Events.h>
  23. #endif
  24.  
  25. #include <ole2.h>
  26. #include "olestd.h"
  27.  
  28.  
  29. #ifndef TRUE
  30. #define FALSE                 0
  31. #define TRUE                 1
  32. #endif
  33.  
  34. #define ENTERKEY             3
  35. #define TABKEY                 9
  36. #define RETURNKEY            13
  37. #define ESCAPEKEY            27
  38. #define UPKEY                30
  39. #define DOWNKEY                31
  40. #define PERIODKEY            46
  41. #define CKEY                99
  42. #define VKEY                118
  43. #define XKEY                120
  44.  
  45.  
  46. //Standard error definitions
  47. #define OLEUI_FALSE                       0
  48. #define OLEUI_SUCCESS                     1     //No error, same as OLEUI_OK
  49. #define OLEUI_OK                          1     //OK button pressed
  50. #define OLEUI_CANCEL                      2     //Cancel button pressed
  51.  
  52. #define OLEUI_ERR_STANDARDMIN           100
  53. #define OLEUI_ERR_STRUCTURENULL         101   //Standard field validation
  54. #define OLEUI_ERR_STRUCTUREINVALID      102
  55. #define OLEUI_ERR_CBSTRUCTINCORRECT     103
  56. #define OLEUI_ERR_DIALOGRES                104
  57. #define OLEUI_ERR_LPSZCAPTIONINVALID    105
  58. #define OLEUI_ERR_LPFNHOOKINVALID       106
  59. #define OLEUI_ERR_HINSTANCEINVALID      107
  60. #define OLEUI_ERR_LPSZTEMPLATEINVALID   108
  61. #define OLEUI_ERR_HRESOURCEINVALID      109
  62.  
  63. #define OLEUI_ERR_FINDTEMPLATEFAILURE   110   //Initialization errors
  64. #define OLEUI_ERR_LOADTEMPLATEFAILURE   111
  65. #define OLEUI_ERR_DIALOGFAILURE         112
  66. #define OLEUI_ERR_LOCALMEMALLOC         113
  67. #define OLEUI_ERR_GLOBALMEMALLOC        114
  68. #define OLEUI_ERR_LOADSTRING            115
  69.  
  70. #define OLEUI_ERR_STANDARDMAX           116   //Start here for specific errors.
  71.  
  72.  
  73. //Result Image IDs
  74. #define RESULTIMAGE_NONE             0xFFFF
  75. #define RESULTIMAGE_PASTE                  0
  76. #define RESULTIMAGE_EMBED                  1
  77. #define RESULTIMAGE_EMBEDICON              2
  78. #define RESULTIMAGE_LINK                  3
  79. #define RESULTIMAGE_LINKICON              4
  80. #define RESULTIMAGE_LINKTOLINK              5
  81. #define RESULTIMAGE_LINKTOLINKICON          6
  82.  
  83.  
  84. //Maximum size of file path (how big should this be?)
  85. #define OLEUI_CCHPATHMAX                256
  86.  
  87. //Maximum verb length and length of Object menu
  88. #define OLEUI_OBJECTMENUMAX                 32
  89.  
  90. //Maximum key size we read from the RegDB.
  91. #define OLEUI_CCHKEYMAX                 256
  92.  
  93. //Icon label length
  94. #define OLEUI_CCHLABELMAX                40
  95.  
  96. //OLE1 ProgID length
  97. #define OLEUI_OLE1PROGIDMAX                40
  98.  
  99. //Resource ID of picture used in Result area
  100. #define OLEUI_PICTID                  10000
  101.  
  102.  
  103.  
  104. /*************************************************************************
  105. ** OLE OBJECT FEEDBACK EFFECTS
  106. *************************************************************************/
  107.  
  108. #define OLEUI_HANDLES_USEINVERSE    0x00000001L
  109. #define OLEUI_HANDLES_NOBORDER      0x00000002L
  110. #define OLEUI_HANDLES_INSIDE        0x00000004L
  111. #define OLEUI_HANDLES_OUTSIDE       0x00000008L
  112.  
  113.  
  114. #define OLEUI_SHADE_FULLRECT        1
  115. #define OLEUI_SHADE_BORDERIN        2
  116. #define OLEUI_SHADE_BORDEROUT       3
  117.  
  118. /* objfdbk.c function prototypes */
  119. STDAPI_(void) OleUIDrawShading(Rect* pRect, GrafPtr drawPort, unsigned long dwFlags, short cWidth);
  120. STDAPI_(void) OleUIDrawHandles(
  121.     Rect*              pRect,
  122.     GrafPtr            drawPort,
  123.     unsigned long   dwFlags,
  124.     short            cSize
  125. );
  126. STDAPI_(void) OleUIShowObject(Rect* pRect, GrafPtr drawPort, Boolean fIsLink);
  127.  
  128.  
  129.  
  130. /*************************************************************************
  131. ** INSERT OBJECT DIALOG
  132. *************************************************************************/
  133.  
  134.  
  135. typedef struct tagOLEUIINSERTOBJECT
  136. {
  137.     //These IN fields are standard across all OLEUI dialog functions.
  138.     unsigned long   cbStruct;       //Structure Size
  139.     unsigned long   dwFlags;        //IN-OUT:  Flags
  140.     char           *lpszCaption;    //Dialog caption bar contents
  141.     Point            ptPosition;        //Dialog position, {0,0} = center
  142.     LPFNOLEUIHOOK   lpfnHook;       //Hook callback
  143.     long            lCustData;      //Custom data to pass to hook
  144.  
  145.     //Specifics for OLEUIINSERTOBJECT.  All are IN-OUT unless otherwise spec.
  146.     CLSID           clsid;            //Return space for class ID
  147.     FSSpec         *pfssFile;         //FSSpec for inserts or links
  148.     char           *pszFile;          //Filename for inserts or links
  149.     unsigned int    cchFile;          //Size of pszFile buffer: OLEUI_CCHPATHMAX
  150.     unsigned int    cClsidExclude;    //IN only:  CLSIDs in lpClsidExclude
  151.     LPCLSID         lpClsidExclude;   //List of CLSIDs to exclude from listing.
  152.  
  153.     //Specific to create objects if flags say so
  154.     IID             iid;              //Requested interface on creation.
  155.     unsigned long   oleRender;        //Rendering option
  156.     LPFORMATETC     lpFormatEtc;      //Desired format
  157.     LPOLECLIENTSITE lpIOleClientSite; //Site to be use for the object.
  158.     LPSTORAGE       lpIStorage;       //Storage used for the object
  159.     void          **ppvObj;           //Where the object is returned.
  160.     SCODE           sc;               //Result of creation calls.
  161.     PicHandle       hMetaPict;              //OUT: PICT containing iconic aspect.
  162. } OLEUIINSERTOBJECT, *POLEUIINSERTOBJECT, *LPOLEUIINSERTOBJECT;
  163.  
  164.  
  165. //API to bring up InsertObject dialog
  166. STDAPI_(unsigned int) OleUIInsertObject(LPOLEUIINSERTOBJECT);
  167.  
  168.  
  169. //Insert Object flags
  170. #define IOF_SHOWHELP                    0x00000001L
  171. #define IOF_SELECTCREATENEW             0x00000002L
  172. #define IOF_SELECTCREATEFROMFILE        0x00000004L
  173. #define IOF_CHECKLINK                   0x00000008L
  174. #define IOF_CHECKDISPLAYASICON          0x00000010L
  175. #define IOF_CREATENEWOBJECT             0x00000020L
  176. #define IOF_CREATEFILEOBJECT            0x00000040L
  177. #define IOF_CREATELINKOBJECT            0x00000080L
  178. #define IOF_DISABLELINK                 0x00000100L
  179. #define IOF_VERIFYSERVERSEXIST          0x00000200L
  180. #define IOF_SELECTDEFAULTFILE            0x00000400L
  181.  
  182.  
  183. //Insert Object specific error codes
  184. #define OLEUI_IOERR_PSZFILEINVALID          (OLEUI_ERR_STANDARDMAX+0)
  185. #define OLEUI_IOERR_LPSZLABELINVALID        (OLEUI_ERR_STANDARDMAX+1)
  186. #define OLEUI_IOERR_HICONINVALID            (OLEUI_ERR_STANDARDMAX+2)
  187. #define OLEUI_IOERR_LPFORMATETCINVALID      (OLEUI_ERR_STANDARDMAX+3)
  188. #define OLEUI_IOERR_PPVOBJINVALID           (OLEUI_ERR_STANDARDMAX+4)
  189. #define OLEUI_IOERR_LPIOLECLIENTSITEINVALID (OLEUI_ERR_STANDARDMAX+5)
  190. #define OLEUI_IOERR_LPISTORAGEINVALID       (OLEUI_ERR_STANDARDMAX+6)
  191. #define OLEUI_IOERR_SCODEHASERROR           (OLEUI_ERR_STANDARDMAX+7)
  192. #define OLEUI_IOERR_LPCLSIDEXCLUDEINVALID   (OLEUI_ERR_STANDARDMAX+8)
  193. #define OLEUI_IOERR_CCHFILEINVALID          (OLEUI_ERR_STANDARDMAX+9)
  194.  
  195.  
  196. //Insert Object Dialog identifiers
  197. #define IO_BTN_OPEN                          1
  198. #define IO_BTN_CANCEL                      2
  199. #define IO_UITEM_VOLUME                      4
  200. #define IO_BTN_EJECT                      5
  201. #define IO_BTN_DRIVE                      6
  202. #define IO_UITEM_FILES                      7
  203. #define IO_UITEM_POPUP                      8
  204. #define IO_UITEM_LINE                      9
  205. #define IO_BTN_OK                         10
  206. #define IO_BTN_HELP                         11
  207. #define IO_CBOX_DISPASICON                 12
  208. #define IO_RBTN_NEW                         13
  209. #define IO_RBTN_FROMFILE                 14
  210. #define IO_UITEM_RESULT                     15
  211. #define IO_UITEM_LBOXNEW                 16
  212. #define IO_UITEM_ICON                     17
  213. #define IO_UITEM_ICONTXT                 18
  214. #define IO_UITEM_OKOUTLINE                 19
  215. #define IO_CBOX_LINK                     20
  216. #define IO_TEXT_TYPE                     21
  217. #define IO_TEXT_RESULT                     22
  218. #define IO_TEXT_CREATE                     23
  219. #define IO_TE_LABELEDIT                     24
  220.  
  221. #define IO_UITEM_FIRST                IO_UITEM_RESULT
  222. #define IO_UITEM_LAST                IO_UITEM_OKOUTLINE
  223.  
  224.  
  225. // Insert Object String IDs
  226. #define IDS_IORESULTNEW                      1
  227. #define IDS_IORESULTNEWICON                  2
  228. #define IDS_IORESULTFROMFILE              3
  229. #define IDS_IORESULTFROMFILEICON          4
  230. #define IDS_IORESULTLINKFILE              5
  231. #define IDS_IORESULTLINKFILEICON          6
  232.  
  233.  
  234.  
  235. /*************************************************************************
  236. ** PASTE SPECIAL DIALOG
  237. *************************************************************************/
  238.  
  239.  
  240. // Maximum number of link types
  241. #define     PS_MAXLINKTYPES  8
  242.  
  243.  
  244. typedef struct tagOLEUIPASTESPECIAL
  245. {
  246.     //These IN fields are standard across all OLEUI dialog functions.
  247.     unsigned long   cbStruct;       //Structure Size
  248.     unsigned long   dwFlags;        //IN-OUT:  Flags
  249.     char           *lpszCaption;    //Dialog caption bar contents
  250.     Point            ptPosition;        //Dialog position, {0,0} = center
  251.     LPFNOLEUIHOOK   lpfnHook;       //Hook callback
  252.     long            lCustData;      //Custom data to pass to hook
  253.  
  254.     //Specifics for OLEUIPASTESPECIAL.
  255.  
  256.     //IN  fields
  257.     LPDATAOBJECT    lpSrcDataObj;   //Source IDataObject* (on the clipboard) for data to paste
  258.  
  259.     POLEUIPASTEENTRY arrPasteEntries; //OLEUIPASTEENTRY array which specifies acceptable formats. See
  260.                                     //  OLEUIPASTEENTRY for more information.
  261.     int             cPasteEntries;  //Number of OLEUIPASTEENTRY array entries
  262.  
  263.     unsigned int    *arrLinkTypes;  //List of link types that are acceptable. Link types are referred
  264.                                     //  to using OLEUIPASTEFLAGS in arrPasteEntries
  265.     int             cLinkTypes;     //Number of link types
  266.  
  267.     //OUT fields
  268.     int             nSelectedIndex; //Index of arrPasteEntries[] that the user selected
  269.     Boolean         fLink;          //Indicates if Paste or Paste Link was selected by the user
  270.     PicHandle        hMetaPict;            //Handle to Metafile containing icon
  271.                                     // and icon title selected by the user
  272.                                     // Use the Metafile utility functions
  273.                                     // defined in this header to
  274.                                     // manipulate hMetaPict
  275. } OLEUIPASTESPECIAL, *POLEUIPASTESPECIAL, *LPOLEUIPASTESPECIAL;
  276.  
  277.  
  278. //API to bring up InsertObject dialog
  279. STDAPI_(unsigned int) OleUIPasteSpecial(LPOLEUIPASTESPECIAL);
  280.  
  281.  
  282. //Paste Special flags
  283. #define PSF_SHOWHELP                    0x00000001L
  284. #define PSF_SELECTPASTE                    0x00000002L
  285. #define PSF_SELECTPASTELINK                0x00000004L
  286. #define PSF_CHECKDISPLAYASICON            0x00000008L
  287.  
  288. // ****************
  289. #define PSF_DISABLEDISPLAYASICON        0x00000010L
  290. // ****************
  291.  
  292.  
  293. //Paste Special specific error codes
  294. #define OLEUI_IOERR_SRCDATAOBJECTINVALID      (OLEUI_ERR_STANDARDMAX+0)
  295. #define OLEUI_IOERR_ARRPASTEENTRIESINVALID    (OLEUI_ERR_STANDARDMAX+1)
  296. #define OLEUI_IOERR_ARRLINKTYPESINVALID       (OLEUI_ERR_STANDARDMAX+2)
  297. #define OLEUI_PSERR_CLIPBOARDCHANGED          (OLEUI_ERR_STANDARDMAX+3)
  298.  
  299.  
  300. //Paste Special Dialog identifiers
  301. #define PS_BTN_OK                          1
  302. #define PS_BTN_CANCEL                      2
  303. #define PS_BTN_HELP                          3
  304. #define PS_CBOX_DISPASICON                  4
  305. #define PS_RBTN_PASTE                      5
  306. #define PS_RBTN_PASTELINK                  6
  307. #define PS_UITEM_RESULT                      7
  308. #define PS_UITEM_LBOX                      8
  309. #define PS_UITEM_SRCTEXT                  9
  310. #define PS_UITEM_ICON                     10
  311. #define PS_UITEM_ICONTXT                 11
  312. #define PS_UITEM_OKOUTLINE                 12
  313. #define PS_TEXT_SOURCE                     13
  314. #define PS_TEXT_AS                         14
  315. #define PS_TEXT_RESULT                     15
  316. #define PS_TE_LABELEDIT                     16
  317.  
  318. #define PS_UITEM_FIRST                PS_UITEM_RESULT
  319. #define PS_UITEM_LAST                PS_UITEM_OKOUTLINE
  320.  
  321. #define PS_ITEM_MAX                    PS_TE_LABELEDIT
  322.  
  323.  
  324. // Paste Special String IDs
  325. #define IDS_PSPASTEDATA                      1
  326. #define IDS_PSPASTEOBJECT                  2
  327. #define IDS_PSPASTEOBJECTASICON              3
  328. #define IDS_PSPASTELINKDATA                  4
  329. #define IDS_PSPASTELINKOBJECT              5
  330. #define IDS_PSPASTELINKOBJECTASICON          6
  331. #define IDS_PSNONOLE                      7
  332. #define IDS_PSUNKNOWNTYPE                  8
  333. #define IDS_PSUNKNOWNSRC                  9
  334. #define IDS_PSUNKNOWNAPP                 10
  335.  
  336.  
  337.  
  338. /*************************************************************************
  339. ** EDIT LINKS DIALOG
  340. *************************************************************************/
  341.  
  342.  
  343. /* IOleUILinkContainer Interface
  344. ** -----------------------------
  345. **    This interface must be implemented by container applications that
  346. **    want to use the EditLinks dialog. the EditLinks dialog calls back
  347. **    to the container app to perform the OLE functions to manipulate
  348. **    the links within the container.
  349. */
  350.  
  351. #define LPOLEUILINKCONTAINER     IOleUILinkContainer *
  352.  
  353. #undef  INTERFACE
  354. #define INTERFACE   IOleUILinkContainer
  355.  
  356. DECLARE_INTERFACE_(IOleUILinkContainer, IUnknown)
  357. {
  358.     BEGIN_INTERFACE
  359.     //*** IUnknown methods ***/
  360.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void * * ppvObj) PURE;
  361.     STDMETHOD_(unsigned long,AddRef) (THIS) PURE;
  362.     STDMETHOD_(unsigned long,Release) (THIS) PURE;
  363.  
  364.     STDMETHOD_(unsigned long,GetNextLink) (THIS_ unsigned long dwLink) PURE;
  365.     STDMETHOD(SetLinkUpdateOptions) (THIS_ unsigned long dwLink, unsigned long dwUpdateOpt) PURE;
  366.     STDMETHOD(GetLinkUpdateOptions) (THIS_ unsigned long dwLink, unsigned long * lpdwUpdateOpt) PURE;
  367.     STDMETHOD(SetLinkSource) (THIS_
  368.             unsigned long    dwLink,
  369.             char *           lpszDisplayName,
  370.             unsigned long    lenFileName,
  371.             unsigned long *  pchEaten,
  372.             Boolean          fValidateSource) PURE;
  373.     STDMETHOD(GetLinkSource) (THIS_
  374.             unsigned long    dwLink,
  375.             char * *         lplpszDisplayName,
  376.             unsigned long *  lplenFileName,
  377.             char * *         lplpszFullLinkType,
  378.             char * *         lplpszShortLinkType,
  379.             Boolean *        lpfSourceAvailable,
  380.             Boolean *        lpfIsSelected) PURE;
  381.     STDMETHOD(OpenLinkSource) (THIS_ unsigned long dwLink) PURE;
  382.     STDMETHOD(UpdateLink) (THIS_
  383.             unsigned long    dwLink,
  384.             Boolean          fErrorMessage,
  385.             Boolean          fErrorAction) PURE;
  386.     STDMETHOD(CancelLink) (THIS_ unsigned long dwLink) PURE;
  387. };
  388.  
  389.  
  390. typedef struct tagOLEUIEDITLINKS
  391. {
  392.     //These IN fields are standard across all OLEUI dialog functions.
  393.     unsigned long   cbStruct;       //Structure Size
  394.     unsigned long   dwFlags;        //IN-OUT:  Flags
  395.     char           *lpszCaption;    //Dialog caption bar contents
  396.     Point            ptPosition;        //Dialog position, {0,0} = center
  397.     LPFNOLEUIHOOK   lpfnHook;       //Hook callback
  398.     long            lCustData;      //Custom data to pass to hook
  399.  
  400.     //Specifics for OLEUIEDITLINKS.  All are IN-OUT unless otherwise spec.
  401.  
  402.     LPOLEUILINKCONTAINER lpOleUILinkContainer;    //IN: Interface to manipulate
  403.                                                 //links in the container
  404. } OLEUIEDITLINKS, *POLEUIEDITLINKS, *LPOLEUIEDITLINKS;
  405.  
  406.  
  407. //API Prototypes
  408. STDAPI_(unsigned int) OleUIEditLinks(LPOLEUIEDITLINKS);
  409.  
  410.  
  411. //Edit Links flags
  412. #define ELF_SHOWHELP                    0x00000001L
  413.  
  414. // ****************
  415. #define ELF_DISABLEUPDATENOW            0x00000002L
  416. #define ELF_DISABLEOPENSOURCE            0x00000004L
  417. #define ELF_DISABLECHANGESOURCE            0x00000008L
  418. #define ELF_DISABLECANCELLINK            0x00000010L
  419. // ****************
  420.  
  421.  
  422. //Edit Links Dialog identifiers
  423. #define EL_BTN_CLOSE                      1
  424. #define EL_BTN_UPDATENOW                  2
  425. #define EL_BTN_OPENSOURCE                  3
  426. #define EL_BTN_CHANGESOURCE                  4
  427. #define EL_BTN_BREAKLINK                  5
  428. #define EL_BTN_HELP                          6
  429. #define EL_RBTN_AUTOMATIC                  7
  430. #define EL_RBTN_MANUAL                      8
  431. #define EL_UITEM_LBOX                      9
  432. #define EL_UITEM_LINKSOURCE                 10
  433. #define EL_UITEM_LINKTYPE                 11
  434. #define EL_UITEM_OKOUTLINE                 12
  435. #define EL_TEXT_LINKS                     13
  436. #define EL_TEXT_TYPE                     14
  437. #define EL_TEXT_UPDATE                     15
  438.  
  439. #define EL_UITEM_FIRST                EL_UITEM_LBOX
  440. #define EL_UITEM_LAST                EL_UITEM_OKOUTLINE
  441.  
  442. #define EL_ITEM_MAX                    EL_UITEM_OKOUTLINE
  443.  
  444.  
  445. // String IDs for Edit Links dialog
  446. #define IDS_LINK_AUTO                      1
  447. #define IDS_LINK_MANUAL                      2
  448. #define IDS_LINK_UNKNOWN                  3
  449. #define IDS_LINKS                          4
  450. #define IDS_FAILED                          5
  451. #define IDS_CHANGESOURCE                  6
  452. #define IDS_INVALIDSOURCE                  7
  453. #define IDS_CHANGEADDITIONALLINKS          8
  454. #define IDS_ERR_GETLINKSOURCE              9
  455. #define IDS_ERR_GETLINKUPDATEOPTIONS     10
  456. #define IDS_ERR_ADDSTRING                 11
  457. #define IDS_BTN_OK                       12
  458. #define IDS_BTN_CANCEL                   13
  459. #define IDS_BTN_CLOSE                    14
  460. #define IDS_BTN_OPEN                     15
  461.  
  462.  
  463.  
  464. /*************************************************************************
  465. ** CONVERT DIALOG
  466. *************************************************************************/
  467. typedef union tagOLEUIOLEFORMAT {
  468.     unsigned long   dwOle2Format;        //OLE2 data format
  469.     char           *lpszOle1Format;        //OLE1 data format
  470. } OLEUIOLEFORMAT;
  471.  
  472. typedef struct tagOLEUICONVERT
  473. {
  474.     //These IN fields are standard across all OLEUI dialog functions.
  475.     unsigned long   cbStruct;       //Structure Size
  476.     unsigned long   dwFlags;        //IN-OUT:  Flags
  477.     char           *lpszCaption;    //Dialog caption bar contents
  478.     Point            ptPosition;        //Dialog position, {0,0} = center
  479.     LPFNOLEUIHOOK   lpfnHook;       //Hook callback
  480.     long            lCustData;      //Custom data to pass to hook
  481.  
  482.     //Specifics for OLEUICONVERT.  All are IN-OUT unless otherwise spec.
  483.     CLSID           clsid;            //Class ID sent in to dialog: IN only
  484.     CLSID           clsidConvertDefault;  //Class ID to use as convert default: IN only
  485.     CLSID           clsidActivateDefault;  //Class ID to use as activate default: IN only
  486.  
  487.     CLSID           clsidNew;         //Selected Class ID: OUT only
  488.     unsigned long   dvAspect;         //IN-OUT, either DVASPECT_CONTENT or
  489.                                       //DVASPECT_ICON
  490.  
  491.     Boolean            fIsOle1Object;    //IN only; true if object is OLE 1.0 object
  492.                                       //  TRUE:  use lpszOle1Format field in following union
  493.                                       //  FALSE: use dwOle2Format field in following union
  494.  
  495.     OLEUIOLEFORMAT    fmt;
  496.  
  497.     Boolean         fIsLinkedObject;  //IN only; true if object is linked
  498.     char           *lpszUserType;     //IN: user type name of original class. We'll do lookup if it's NULL.
  499.                                       //This gets freed on exit.
  500.     Boolean         fObjectsIconChanged;  // OUT; TRUE if ChangeIcon was called (and not cancelled)
  501.  
  502.     PicHandle       hMetaPict;        //IN-OUT: METAFILEPICT containing iconic aspect.
  503.     char            *pszDefLabel;     //IN-OUT: default label to use for icon.
  504.                                       //  if NULL, the short user type name
  505.                                       //  will be used. if the object is a
  506.                                       //  link, the caller should pass the
  507.                                       //  DisplayName of the link source
  508.                                       //  This gets freed on exit.
  509.  
  510.  
  511. } OLEUICONVERT, *POLEUICONVERT, *LPOLEUICONVERT;
  512.  
  513.  
  514. //API prototype
  515. STDAPI_(unsigned int) OleUIConvert(LPOLEUICONVERT);
  516. STDAPI_(Boolean) OleUICanConvertOrActivateAs(
  517.         REFCLSID        rClsid,
  518.         Boolean            fIsLinkedObject,
  519.         Boolean            fIsOle1Object,
  520.         OLEUIOLEFORMAT     Format
  521. );
  522.  
  523. //Convert Dialog flags
  524.  
  525. // IN only: Shows "HELP" button
  526. #define CF_SHOWHELP                        0x00000001L
  527.  
  528. // IN only: lets you set the convert default object - the one that is
  529. // selected as default in the convert listbox.
  530. #define CF_SETCONVERTDEFAULT            0x00000002L
  531.  
  532.  
  533. // IN only: lets you set the activate default object - the one that is
  534. // selected as default in the activate listbox.
  535.  
  536. #define CF_SETACTIVATEDEFAULT            0x00000004L
  537.  
  538.  
  539. // IN/OUT: Selects the "Convert To" radio button, is set on exit if
  540. // this button was selected
  541. #define CF_SELECTCONVERTTO                0x00000008L
  542.  
  543. // IN/OUT: Selects the "Activate As" radio button, is set on exit if
  544. // this button was selected
  545. #define CF_SELECTACTIVATEAS                0x00000010L
  546.  
  547. // ****************
  548. #define CF_DISABLEDISPLAYASICON            0x00000020L
  549. #define CF_DISABLEACTIVATEAS            0x00000040L
  550. // ****************
  551.  
  552.  
  553. //Convert specific error codes
  554. #define OLEUI_CTERR_CLASSIDINVALID      (OLEUI_ERR_STANDARDMAX+1)
  555. #define OLEUI_CTERR_DVASPECTINVALID     (OLEUI_ERR_STANDARDMAX+2)
  556. #define OLEUI_CTERR_CBFORMATINVALID     (OLEUI_ERR_STANDARDMAX+3)
  557. #define OLEUI_CTERR_HMETAPICTINVALID    (OLEUI_ERR_STANDARDMAX+4)
  558. #define OLEUI_CTERR_STRINGINVALID       (OLEUI_ERR_STANDARDMAX+5)
  559.  
  560.  
  561. //Convert Dialog identifiers
  562. #define CV_BTN_OK                          1
  563. #define CV_BTN_CANCEL                      2
  564. #define CV_BTN_HELP                          3
  565. #define CV_CBOX_DISPASICON                  4
  566. #define CV_RBTN_CONVERT                      5
  567. #define CV_RBTN_ACTIVATE                  6
  568. #define CV_UITEM_RESULT                      7
  569. #define CV_UITEM_LBOX                      8
  570. #define CV_UITEM_SRCTEXT                  9
  571. #define CV_UITEM_ICON                     10
  572. #define CV_UITEM_ICONTXT                 11
  573. #define CV_UITEM_OKOUTLINE                 12
  574. #define CV_TEXT_SOURCE                     13
  575. #define CV_TEXT_AS                         14
  576. #define CV_TEXT_RESULT                     15
  577. #define CV_TE_LABELEDIT                     16
  578.  
  579. #define CV_UITEM_FIRST                CV_UITEM_RESULT
  580. #define CV_UITEM_LAST                CV_UITEM_OKOUTLINE
  581.  
  582. #define CV_ITEM_MAX                    CV_TE_LABELEDIT
  583.  
  584.  
  585. // String IDs for Convert dialog
  586. #define IDS_CVRESULTCONVERTLINK              1
  587. #define IDS_CVRESULTCONVERTTO              2
  588. #define IDS_CVRESULTNOCHANGE              3
  589. #define IDS_CVRESULTDISPLAYASICON          4
  590. #define IDS_CVRESULTACTIVATEAS              5
  591. #define IDS_CVRESULTACTIVATEDIFF          6
  592.  
  593.  
  594.  
  595. /*************************************************************************
  596. ** Update Links DIALOG
  597. *************************************************************************/
  598.  
  599. #define UL_BTN_STOP                          1
  600. #define UL_UITEM_METER                      2
  601. #define UL_TEXT_PERCENT                      3
  602.  
  603. STDAPI_(Boolean) OleUIUpdateLinks(LPOLEUILINKCONTAINER lpOleUILinkCntr, int cLinks);
  604.  
  605.  
  606.  
  607. /*************************************************************************
  608. ** Miscellaneous utility functions
  609. *************************************************************************/
  610.  
  611. typedef struct VerbRec {
  612.     short     menuID;
  613.     short     menuItem;
  614.     long    verb;
  615. } VerbRec;
  616.  
  617. typedef struct VerbMenuRec {
  618.     short     ConvertMenuID;
  619.     short     ConvertMenuItem;
  620.     short    verbCount;
  621.     VerbRec    *verbRec;
  622. } VerbMenuRec;
  623.     
  624. //API prototype
  625. STDAPI_(Boolean) OleUIAddVerbMenu(
  626.         LPOLEOBJECT     lpOleObj,
  627.         char*             lpszShortType,
  628.         MenuHandle         hEditMenu,
  629.         short            idEditMenu,
  630.         MenuHandle        hVerbMenu,
  631.         short            idVerbMenu,
  632.         unsigned int    uVerbPos,
  633.         Boolean         bAddConvert,
  634.         VerbMenuRec*    pVerbMenuRec
  635. );
  636.  
  637. STDAPI_(Boolean) OleUIFindVerbConvert(
  638.         VerbMenuRec*     pVerbMenuRec,
  639.         short             menuID,
  640.         short             menuItem,
  641.         Boolean*        pConvert,
  642.         long*             pVerb
  643. );
  644.  
  645. // String IDs
  646. #define IDS_OLE2UIUNKNOWN               11000
  647. #define IDS_OLE2UILINK                  11001
  648. #define IDS_OLE2UIOBJECT                11002
  649. #define IDS_OLE2UIEDIT                  11003
  650. #define IDS_OLE2UICONVERT               11004
  651. #define IDS_OLE2UIEDITLINKCMD_1VERB     11005
  652. #define IDS_OLE2UIEDITOBJECTCMD_1VERB   11006
  653. #define IDS_OLE2UIEDITLINKCMD_NVERB     11007
  654. #define IDS_OLE2UIEDITOBJECTCMD_NVERB   11008
  655. #define IDS_OLE2UIEDITNOOBJCMD          11009
  656.  
  657.  
  658.  
  659. /*************************************************************************
  660. ** BUSY DIALOG
  661. *************************************************************************/
  662.  
  663.  
  664. typedef struct tagOLEUIBUSY {
  665.  
  666.     //These IN fields are standard across all OLEUI dialog functions.
  667.     unsigned long       cbStruct;         //Structure Size
  668.     unsigned long       dwFlags;          //IN-OUT:  Flags ** NOTE ** this dialog has no flags
  669.     char                *lpszCaption;      //Dialog caption bar contents
  670.     Point                ptPosition;        //Dialog position, {0,0} = center
  671.     LPFNOLEUIHOOK       lpfnHook;         //Hook callback
  672.     long                  lCustData;        //Custom data to pass to hook
  673.  
  674.     //Specifics for OLEUIBUSY.
  675.     ProcessSerialNumberPtr      pPSN;            //IN: HTask which is blocking
  676. } OLEUIBUSY, *POLEUIBUSY, *LPOLEUIBUSY;
  677.  
  678. //API prototype
  679. STDAPI_(unsigned int) OleUIBusy(LPOLEUIBUSY);
  680.  
  681. // Flags for this dialog
  682.  
  683. // IN only: Disables "Cancel" button
  684. #define BZ_DISABLECANCELBUTTON          0x00000001L
  685.  
  686. // IN only: Disables "Switch To..." button
  687. #define BZ_DISABLESWITCHTOBUTTON        0x00000002L
  688.  
  689. // IN only: Disables "Retry" button
  690. #define BZ_DISABLERETRYBUTTON           0x00000004L
  691.  
  692. // IN only: Generates a "Not Responding" dialog as opposed to the
  693. // "Busy" dialog.  The wording in the text is slightly different, and
  694. // the "Cancel" button is grayed out if you set this flag.
  695. #define BZ_NOTRESPONDINGDIALOG          0x00000008L
  696.  
  697. // Busy specific error/return codes
  698. #define OLEUI_BZERR_HTASKINVALID     (OLEUI_ERR_STANDARDMAX+0)
  699.  
  700. // SWITCHTOSELECTED is returned when user hit "switch to"
  701. #define OLEUI_BZ_SWITCHTOSELECTED    (OLEUI_ERR_STANDARDMAX+1)
  702.  
  703. // RETRYSELECTED is returned when user hit "retry"
  704. #define OLEUI_BZ_RETRYSELECTED       (OLEUI_ERR_STANDARDMAX+2)
  705.  
  706. // CALLUNBLOCKED is returned when call has been unblocked
  707. #define OLEUI_BZ_CALLUNBLOCKED       (OLEUI_ERR_STANDARDMAX+3)
  708.  
  709. // String IDs
  710. #define IDS_BZRESULTTEXTNOTRESPONDING        11010
  711. #define IDS_BZRESULTTEXTBUSY                11011
  712. #define IDS_APPBLOCKED                        11012
  713.  
  714. #define OLEUI_ICONFRAME                 3
  715. #define OLEUI_LBOXFRAME                 3
  716.  
  717.  
  718.  
  719. /*************************************************************************
  720. ** PROMPT USER DIALOGS
  721. *************************************************************************/
  722.  
  723. // The following Dialogs are message dialogs used by OleUIPromptUser API
  724. #define IDD_INVALIDSOURCE            10020
  725. #define IDD_LINKSOURCEUNAVAILABLE   10021
  726. #define IDD_SERVERNOTREG            10022
  727. #define IDD_LINKTYPECHANGED         10023
  728. #define IDD_SERVERNOTFOUND          10024
  729. #define IDD_OUTOFMEMORY             10025
  730.  
  731. #define PU_TEXT_MESSAGE                1
  732. #define PU_BTN_LINKS                2
  733. #define PU_BTN_TEXT                    3
  734. #define PU_BTN_CONVERT                4
  735. #define PU_BTN_BROWSE                5
  736. #define PU_BTN_YES                    6
  737. #define PU_BTN_NO                    7
  738.  
  739. #define PU_BTN_FIRST                2
  740.  
  741. /* inside ole2ui.c */
  742.  
  743. #ifdef _MSC_VER
  744. short _cdecl OleUIPromptUser(int nTemplate, ...);
  745. #else
  746. short OleUIPromptUser(int nTemplate, ...);
  747. #endif
  748.  
  749.  
  750.  
  751. /*************************************************************************
  752. ** MESSAGE FILTER ROUTINES
  753. *************************************************************************/
  754.  
  755. /* a significant message is consider a mouse click or keyboard input. */
  756. #define UserInputMask        mDownMask | mUpMask | keyDownMask | keyUpMask | autoKeyMask
  757. #define UrgentEvtMask        updateMask | activMask | osMask
  758.  
  759. // Message Pending callback procedure
  760. typedef Boolean (*MSGPENDINGPROC)(long userData);
  761.  
  762. // HandleInComingCall callback procedure
  763. typedef unsigned long (*HANDLEINCOMINGCALLBACKPROC)
  764.     (
  765.         unsigned long            dwCallType,
  766.         ProcessSerialNumberPtr   htaskCaller,
  767.         unsigned long            dwTickCount,
  768.         LPINTERFACEINFO          lpInterfaceInfo
  769.     );
  770.  
  771. STDAPI_(void) OleStdMessageFilterInitInterfaces(void);
  772.  
  773. STDAPI_(LPMESSAGEFILTER) OleStdMsgFilter_Create(
  774.         char*             szAppName,
  775.         MSGPENDINGPROC lpfnCallback,
  776.         LPFNOLEUIHOOK  lpfnOleUIHook,         // Busy dialog hook callback
  777.         long            userData);
  778.  
  779. STDAPI_(void) OleStdMsgFilter_SetInComingCallStatus(
  780.         LPMESSAGEFILTER lpThis, unsigned long dwInComingCallStatus);
  781.  
  782. STDAPI_(unsigned long) OleStdMsgFilter_GetInComingCallStatus(
  783.         LPMESSAGEFILTER lpThis);
  784.  
  785. STDAPI_(HANDLEINCOMINGCALLBACKPROC)
  786.     OleStdMsgFilter_SetHandleInComingCallbackProc(
  787.         LPMESSAGEFILTER             lpThis,
  788.         HANDLEINCOMINGCALLBACKPROC  lpfnHandleInComingCallback);
  789.  
  790. STDAPI_(Boolean) OleStdMsgFilter_EnableBusyDialog(
  791.         LPMESSAGEFILTER lpThis, Boolean fEnable);
  792.  
  793. STDAPI_(Boolean) OleStdMsgFilter_EnableNotRespondingDialog(
  794.         LPMESSAGEFILTER lpThis, Boolean fEnable);
  795.  
  796.  
  797.  
  798. #if defined(__cplusplus) && !defined(__MWERKS__)
  799. }
  800. #endif
  801.  
  802.  
  803. #endif //_OLE2UI_H_
  804.